package com.collect.collect.api.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.collect.collect.api.dao.HospitalListMapper;
import com.collect.collect.api.entity.HospitalList;
import com.collect.collect.api.service.IHospitalListService;
import com.collect.collect.config.annotation.DataSource;
import com.collect.collect.config.enums.DataSourceType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
@DataSource(DataSourceType.SLAVE)
public class HospitalListServiceImpl extends ServiceImpl<HospitalListMapper, HospitalList> implements IHospitalListService {

    @Autowired
    private HospitalListMapper hospitalListMapper;

    /**
     * 根据ID获取数据
     * @param id
     * @return
     */
    @Override
    public HospitalList selectHospitalListById(String id) {
        return hospitalListMapper.selectById(id);
    }

    /**
     * 更新
     *
     * @param hospitalList
     * @return
     */
    @Override
    public int updateHospitalList(HospitalList hospitalList) {
        return hospitalListMapper.updateById(hospitalList);
    }
}
